package com.xxx.hhh.demo.demo6;

import java.io.*;
import java.net.InetAddress;
import java.net.Socket;

public class ClientDemo {
    public static void main(String[] args) throws IOException {
        Socket ss = new Socket(InetAddress.getByName("127.0.0.1"),10000);
        OutputStream os = ss.getOutputStream();
        os.write("你是哪个".getBytes());
        InputStream is = ss.getInputStream();
        ss.shutdownInput();
        BufferedReader br = new BufferedReader(new InputStreamReader(is));
        String s = br.readLine();
        System.out.println(s);

        os.close();
        ss.close();
    }
}
